import reqUrl from "./reqUrl";
import {fetch, fetchGet} from "../api";

const getProductsFn = params => {
  return fetchGet(reqUrl.productList, params)
};
const getCategoryInfosFn = params => {
  return fetchGet(reqUrl.categoryInfoList, params)
};
const uploadImgFn = params => {
  return fetch(reqUrl.uploadImg, params)
}
const addProductFn = params => {
  return fetch(reqUrl.addProduct, params);
}
const getProductFn = params => {
  return fetchGet(reqUrl.getProduct, params);
}
const updateProductInfoFn = params => {
  return fetch(reqUrl.updateProductInfo, params);
}
const delProductFn = params => {
  return fetch(reqUrl.delProduct, params);
}
const getCategoryFn = params => {
  return fetchGet(reqUrl.getCategory, params);
}
const updateCategoryFn = params => {
  return fetch(reqUrl.updateCategory, params);
}
const delCategoryFn = params => {
  return fetch(reqUrl.delCategory, params);
}
const addCategoryFn = params =>{
  return fetch(reqUrl.addCategory, params);
}
const getAdvertListFn = params => {
  return fetchGet(reqUrl.getAdvertList, params);
}
const getAdvertFn = params => {
  return fetchGet(reqUrl.getAdvert, params);
}
const updateAdvertFn = params => {
  return fetch(reqUrl.updateAdvert, params);
}
const addAdvertFn = params => {
  return fetch(reqUrl.addAdvert, params);
}
const getCouponListFn = params => {
  return fetchGet(reqUrl.getCouponList, params);
}
const getCouponFn = params => {
  return fetchGet(reqUrl.getCoupon, params);
}
const updateCouponFn = params => {
  return fetch(reqUrl.updateCoupon, params);
}
const addCouponFn = params => {
  return fetch(reqUrl.addCoupon, params);
}
const delCouponFn = params => {
  return fetch(reqUrl.delCoupon, params);
}
const getCommentFn = params => {
  return fetchGet(reqUrl.getComment, params);
}
const getUserListFn = params => {
  return fetchGet(reqUrl.getUserList, params);
}
const getTokenFn = params => {
  return fetchGet(reqUrl.getToken, params);
}
const getShopOrderListFn = params => {
  return fetchGet(reqUrl.getShopOrderList, params);
}
const getOrderByOrderIdFn = params => {
  return fetchGet(reqUrl.getOrderByOrderId, params);
}
const getShopListFn = () => {
  return fetchGet(reqUrl.getShopList, {});
}
const getShopFn = params => {
  return fetchGet(reqUrl.getShop, params);
}
const updateShopFn = params => {
  return fetch(reqUrl.updateShop, params);
}
const getUserListByNullFn = () => {
  return fetchGet(reqUrl.getUserListByNull, {});
}
const addShopFn = params => {
  return fetch(reqUrl.addShop, params);
}
const uploadParamaFn = () => {
  return fetchGet(reqUrl.uploadParam, {});
}

const reqApis = {
  getProductsFn,
  getCategoryInfosFn,
  uploadImgFn,
  addProductFn,
  getProductFn,
  updateProductInfoFn,
  delProductFn,
  getCategoryFn,
  updateCategoryFn,
  delCategoryFn,
  addCategoryFn,
  getAdvertListFn,
  getAdvertFn,
  updateAdvertFn,
  addAdvertFn,
  getCouponListFn,
  getCouponFn,
  updateCouponFn,
  addCouponFn,
  delCouponFn,
  getCommentFn,
  getUserListFn,
  getTokenFn,
  getShopOrderListFn,
  getOrderByOrderIdFn,
  getShopListFn,
  getShopFn,
  updateShopFn,
  getUserListByNullFn,
  addShopFn,
  uploadParamaFn
}
export default reqApis